<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 运算符的优先级
        // a = [b,(b = a)] [0];
        // console.log(a,b);

        console.log(NaN === NaN);
        console.log(0 + '');
        console.log(0 || '');

        var arr = 0;
        console.log(!!arr);
        console.log(!![]);
        console.log(!![1, 2, 3]);
        console.log((!(~+[]) + {})[--[~+""][+[]] * [~+[]] + ~~!+[]] + ({} + [])[[~!+[]] * ~+[]]);
        // 短路运算
        console.log('abc' && null); //null
        console.log(null && 'abc'); // null
        console.log(null && undefined); //null
        console.log(undefined && null); // undefined

        var b = null;
        console.log(!!b);

        var c = 9;
        console.log(!!c);
    </script>

</body>

</html>